//
//  ToolsView.m
//  BJS151148_ TeamProject_Travel
//
//  Created by lanou3g on 16/3/22.
//  Copyright © 2016年 lanou3g. All rights reserved.
//

#import "ToolsView.h"

@implementation ToolsView

- (instancetype)initWithFrame:(CGRect)frame{

    if (self == [super initWithFrame:frame]) {
        
        [self initLayout];
    }
    return self;
}
- (void)initLayout{

    self.cityLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height / 10 - 50, [UIScreen mainScreen].bounds.size.width, 30)];
    self.cityLabel.text = @"北京";
    self.cityLabel.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.cityLabel];
    
    self.chooseBT = [UIButton buttonWithType:UIButtonTypeSystem];
    self.chooseBT.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - 50 , [UIScreen mainScreen].bounds.size.height / 10 - 20, 100, 30);

    [self.chooseBT setTitle:@"选择城市" forState:UIControlStateNormal];
    [self.chooseBT setTintColor:[UIColor grayColor]];
    [self addSubview:self.chooseBT];
    
    self.minLabel = [[UILabel alloc] initWithFrame:CGRectMake([UIScreen mainScreen].bounds.size.width / 2 - 100, [UIScreen mainScreen].bounds.size.height / 9, 80, 100)];

    self.minLabel.font = [UIFont boldSystemFontOfSize:60];
    self.minLabel.text = @"7";
    self.minLabel.textAlignment = NSTextAlignmentCenter;
    self.minLabel.textColor = [UIColor colorWithRed:0 green:191/255.0 blue:255/255.0 alpha:1];
    [self addSubview:self.minLabel];
    
    self.minLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.minLabel.frame) - 20, [UIScreen mainScreen].bounds.size.height / 9+10, 80, 50)];
 
    self.minLabel1.font = [UIFont boldSystemFontOfSize:30];
    self.minLabel1.text = @"℃";
    self.minLabel1.textColor = [UIColor colorWithRed:0 green:191/255.0 blue:255/255.0 alpha:1];
    [self addSubview:self.minLabel1];
    
    UIView *lineView = [[UIView alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.minLabel1.frame) - 60, CGRectGetMidY(self.minLabel.frame), 40, 2)];
    lineView.backgroundColor = [UIColor grayColor];
    [self addSubview:lineView];
    
    self.maxLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(lineView.frame), [UIScreen mainScreen].bounds.size.height / 9, 80, 100)];
    
    self.maxLabel.text = @"15";
    self.maxLabel.textColor = [UIColor redColor];
    self.maxLabel.font = [UIFont boldSystemFontOfSize:60];
    [self addSubview:self.maxLabel];
    
    self.maxLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(self.maxLabel.frame) - 20, [UIScreen mainScreen].bounds.size.height / 9+10, 80, 50)];
    self.maxLabel2.font = [UIFont boldSystemFontOfSize:30];
    self.maxLabel2.text = @"℃";
    self.maxLabel2.textColor = [UIColor redColor];
    [self addSubview:self.maxLabel2];
    
    self.timeLabel = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMinX(self.minLabel.frame), CGRectGetMaxY(self.minLabel.frame), [UIScreen mainScreen].bounds.size.width - 2 * CGRectGetMinX(self.minLabel.frame), 50)];
    self.timeLabel.text = @"当地时间 09:36";
    self.timeLabel.textAlignment = NSTextAlignmentCenter;
    self.timeLabel.font = [UIFont systemFontOfSize:14];
    [self addSubview:self.timeLabel];
    
    self.bookkeepingBT = [UIButton buttonWithType:UIButtonTypeSystem];
    self.bookkeepingBT.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 8, CGRectGetMaxY(self.minLabel.frame)+60, [UIScreen mainScreen].bounds.size.width / 4, [UIScreen mainScreen].bounds.size.width / 4);

    [self.bookkeepingBT setImage:[UIImage imageNamed:@"iconfont-iconshouzhijizhang-2"] forState:UIControlStateNormal];
    [self.bookkeepingBT setTintColor:[UIColor blackColor]];
    [self addSubview:self.bookkeepingBT];
    
    self.translateBT = [UIButton buttonWithType:UIButtonTypeSystem];
    self.translateBT.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 8 * 5, CGRectGetMaxY(self.minLabel.frame)+60, [UIScreen mainScreen].bounds.size.width / 4, [UIScreen mainScreen].bounds.size.width / 4);

    [self.translateBT setImage:[UIImage imageNamed:@"iconfont-fanyifuwu"] forState:UIControlStateNormal];
    [self.translateBT setTintColor:[UIColor blackColor]];
    [self addSubview:self.translateBT];
    
    self.mapBT = [UIButton buttonWithType:UIButtonTypeSystem];
    self.mapBT.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 8, CGRectGetMaxY(self.minLabel.frame)+ 200, [UIScreen mainScreen].bounds.size.width / 4, [UIScreen mainScreen].bounds.size.width / 4);

    [self.mapBT setImage:[UIImage imageNamed:@"iconfont-ditu"] forState:UIControlStateNormal];
    [self.mapBT setTintColor:[UIColor blackColor]];
    [self addSubview:self.mapBT];
    
    self.paritiesBT = [UIButton buttonWithType:UIButtonTypeSystem];
    self.paritiesBT.frame = CGRectMake([UIScreen mainScreen].bounds.size.width / 8 * 5, CGRectGetMaxY(self.minLabel.frame)+200, [UIScreen mainScreen].bounds.size.width / 4, [UIScreen mainScreen].bounds.size.width / 4);

    [self.paritiesBT setImage:[UIImage imageNamed:@"iconfont-huilvhuansuan"] forState:UIControlStateNormal];
    [self.paritiesBT setTintColor:[UIColor blackColor]];
    [self addSubview:self.paritiesBT];
    
    
}
@end
